<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<title>Modify Question</title>
	<link rel="stylesheet" type="text/css" href="style.css" media="screen" />
</head>

<body>

<jsp:include page="common/header.jsp"/>

<center><b>The Contents</b></center><br>

<html:form action="/jsp/ModifyQuestion.do">
		
<b>The Question number to be Modified<br>
<%@page language="java" import="OnlineExam.question.*"%>
<%
	Question question = Question.retrieveQuestion (Integer.parseInt(request.getParameter("questionNumber")));
%>
<html:errors/>
<html:text  property="number" size="4" value="<%= Integer.toString(question.getNumber()) %>"/><br /><br />
Category:<html:text property="categoryId" size="5" value="<%=question.getCategoryId()%>"/><br /><br/>
<b>The Question to be Modified </b><br><br>
<html:textarea property="question" value="<%=question.getQuestion()%>"></html:textarea>
		
<br><br><br>Answers<br><br><br>
<% 
	
	String answers[] = question.splitOptions();

	for (int j = 0; j < answers.length; j++)
	{
%>
		<tr><html:textarea property="optionsArr" value="<%= answers[j] %>"></html:textarea><%= (j + 1) %>
		<html:radio property="correctAnswer" value = "<%= Integer.toString((j + 1)) %>" /><br><br></tr>	
	
<% 
	}
%>
	<br>

	Explanation <br />
	<html:textarea property="explanation" value="<%= question.getExplanation() %>"></html:textarea>
	<br><br><br>
	
	Marks For Correct Answer
	<html:text property="correctMarks" size = "4" value ="<%= Integer.toString(question.getCorrectMarks()) %>"/>
	
	<br><br>

	Marks For Wrong Answer
	<html:text property="wrongMarks" size = "4" value="<%= Integer.toString(question.getWrongMarks()) %>" />
	
	<br><center>
	<html:submit/></center>
</html:form>

</body>
</html>

